#include<stdio.h>

int main(){
	int n;
	scanf("%d",&n);
	int m=1;
	int sum=0;
	while(m<n){
		if(n%m==0){
			sum+=m;
		}
		m+=1;
	}
	if(sum==n){
		printf("%d is perfect.",n);
	}
	
	else{
		printf("%d is not perfect.",n);
	} 
}
